@@ -0,0 +1,19 @@ |
||
1 |
+# -*- coding: utf-8 -*- |
|
2 |
+from __future__ import unicode_literals |
|
3 |
+ |
|
4 |
+from django.db import models, migrations |
|
5 |
+ |
|
6 |
+ |
|
7 |
+class Migration(migrations.Migration): |
|
8 |
+ |
|
9 |
+ dependencies = [ |
|
10 |
+ ('group', '0022_auto_20160901_1439'), |
|
11 |
+ ] |
|
12 |
+ |
|
13 |
+ operations = [ |
|
14 |
+ migrations.AddField( |
|
15 |
+ model_name='groupinfo', |
|
16 |
+ name='group_initio', |
|
17 |
+ field=models.BooleanField(default=False, help_text='\u7fa4\u7ec4\u67e5\u770b\u7167\u7247\u4ece\u5934\u5f00\u59cb', verbose_name='group_initio'), |
|
18 |
+ ), |
|
19 |
+ ] |
@@ -32,6 +32,7 @@ class GroupInfo(CreateUpdateMixin): |
||
32 | 32 |
group_from = models.IntegerField(_(u'group_from'), choices=GROUP_FROM, default=APP_GROUP, help_text=u'群组来源') |
33 | 33 |
session_id = models.CharField(_(u'session_id'), max_length=255, blank=True, null=True, help_text=u'照片组唯一标识', db_index=True) |
34 | 34 |
group_lock = models.BooleanField(_(u'group_lock'), default=False, help_text=u'群组锁定') |
35 |
+ group_initio = models.BooleanField(_(u'group_initio'), default=False, help_text=u'群组查看照片从头开始') |
|
35 | 36 |
|
36 | 37 |
class Meta: |
37 | 38 |
verbose_name = _(u'groupinfo') |
@@ -55,6 +56,7 @@ class GroupInfo(CreateUpdateMixin): |
||
55 | 56 |
'group_desc': self.group_desc, |
56 | 57 |
'group_from': self.group_from, |
57 | 58 |
'group_lock': self.group_lock, |
59 |
+ 'group_initio': self.group_initio, |
|
58 | 60 |
'created_at': self.created_at.replace(microsecond=0), |
59 | 61 |
} |
60 | 62 |
|
@@ -225,7 +225,7 @@ def group_join_api(request): |
||
225 | 225 |
user_id=user_id, |
226 | 226 |
) |
227 | 227 |
if group_user.user_status != GroupUserInfo.PASSED: |
228 |
- group_user.current_id = int(r.get(GROUP_LAST_PHOTO_PK % group_id) or -1) |
|
228 |
+ group_user.current_id = -1 if group.group_from == GroupInfo.SESSION_GROUP else int(r.get(GROUP_LAST_PHOTO_PK % group_id) or -1) |
|
229 | 229 |
group_user.nickname = nickname or user.final_nickname |
230 | 230 |
group_user.avatar = user.avatar |
231 | 231 |
# group_user.admin = False # Admin Field Default False, Should Not Assign |